import request from "@/utils/request";
import store from "@/store";

// 查询通知list数据
export function getMessageDataApi(params) {
  return request({
    url: '/crm/inform/list',
    method: 'GET',
    params: {
      ...params,
      userId: store.state.user.id,
      deptId: store.state.user.deptId,
    }
  })
}

// 更新全部通知数据
export function updateAllMessageListApi(data) {
  return request({
    url: '/crm/inform/updateAll',
    method: 'PUT',
    data
  })
}

// 更新数据信息
export function updateMessageApi(data) {
  return request({
    url: '/crm/inform/update',
    method: 'PUT',
    data
  })
}

// 查询所有未读未通知的数据信息
export function updateNoReadNoInformMessageApi(params) {
  return request({
    url: '/crm/inform/selectNoNoticeInfo',
    method: 'GET',
    params
  })
}

// 获取周报详细信息
export function getMessageInfoApi(params) {
  return request({
    url: '/crm/inform/selectNewspaperById',
    method: 'GET',
    params
  })
}

